]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Use addSettingsItem() in language menu
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 15 Nov 2018 14:38:11 +0000 (15:38 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 16 Jan 2019 00:29:23 +0000 (00:29 +0000)
If the session mode doesn't allow access to Settings, the language
menu should respect that and not expose the "Region & Languages"
panel. Using the dedicated method instead of manually constructing
the menu item takes care of that and makes for less code.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/780

js/ui/keyboard.js

index 106c302100c6dd4d2d1aaccd1ea357b96d060244..fac42671decae4f7a0a8055dc0324ee66714f975 100644 (file)
@@ -195,7 +195,7 @@ var LanguageSelectionPopup = new Lang.Class({
         }
 
         this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
-        this.addAction(_("Region & Language Settings"), this._launchSettings.bind(this));
+        this.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop');
         this._capturedEventId = 0;
 
         this._unmapId = actor.connect('notify::mapped', () => {
@@ -204,11 +204,6 @@ var LanguageSelectionPopup = new Lang.Class({
         });
     },
 
-    _launchSettings() {
-        Util.spawn(['gnome-control-center', 'region']);
-        this.close(true);
-    },
-
     _onCapturedEvent(actor, event) {
         if (event.get_source() == this.actor ||
             this.actor.contains(event.get_source()))